package com.opoc.mapper;


import com.opoc.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.Timestamp;
import java.util.List;


/**
 * 变更审核
 */
@Mapper
public interface ChangeReviewMapper {

    /**
     *5.1待审核变更请求查询
     */
     List<ChangeCheck_sql> WaitingForReview(@Param("company_id") String company_id,
                                          @Param("company_name") String company_name,
                                          @Param("contacts") String contacts);

    /**
     *5.2 已审核变更请求查询
     */
    List<ChangeRequest_sql> ReviewedForChanges(@Param("company_id") String company_id,
                                               @Param("company_name")String company_name,
                                               @Param("contacts") String contacts);

    /**
     * 已审核变更请求删除
     */
    void deleteByList(@Param("list") List<String> list);



    /**
     * 5.4待审核变更请求批复
     */

    void change(@Param("company_id")String company_id,
                @Param("auditor_id")String auditor_id,
                @Param("auditor_result")Integer auditor_result,
                @Param("submit_date")Timestamp submit_date);
    //通过request_id查找接口
    @Select("select * from opoc.change_request_info where request_id = #{request_id} ")
    ChangeRequest_sql selectMesage(@Param("request_id")Integer request_id);

    /**
     * 5.5发起变更请求
     */
    void insert(@Param("company_id") String company_id,
                @Param("change_properties") Integer change_properties,
                @Param("new_value")String new_value,
                @Param("submit_date") Timestamp submit_date,
                @Param("uploadFile") String uploadFile,
                @Param("name") String name,
                @Param("phoneNum") String phoneNum);


    /**
     * 5.6发起检测报告变更请求
     */
//    void insertPool(PoolChange poolchange);

//    void insertFile(String companyId, String testData2, String name,String uploadFile);


//    void evidence_file(@Param("company_id") String company_id,
//                       @Param("uploadFile") String uploadFile);
    void insertPool(@Param("company_id") String company_id,
                    @Param("lhq_top") Double lhq_top,
                    @Param("lhq_bottom") Double lhq_bottom,
                    @Param("co_top") Double co_top,
                    @Param("co_bottom") Double co_bottom,
                    @Param("gas_top") Double gas_top,
                    @Param("gas_bottom") Double gas_bottom,
                    @Param("test_organization") String test_organization,
                    @Param("submit_date") Timestamp submit_date);


    void insertFile(@Param("company_id") String company_id,
                    @Param("test_date") String test_date,
                    @Param("name") String name,
                    @Param("uploadFile") String uploadFile);
}
